package at.ttasat;

import java.util.Random;

public class RunDescription {
	private final int variables;
	private final int clauses;
	private final long cnfSeed;

	public RunDescription(long seed, int maxVariable, int maxClauses, double weightingFactor) {
		cnfSeed = seed;
		Random random = new Random(seed);
		variables = getWeighted(random, maxVariable, weightingFactor);
		clauses = getWeighted(random, maxClauses, weightingFactor);
	}

	private static int getWeighted(Random random, int max, double weightingFactor) {
		return (int) (Math.pow(random.nextDouble(), weightingFactor) * max) + 1;
	}

	public String getDimacsString() {
		return DimacsFuzzer.getRandomCnf(variables, clauses, cnfSeed);
	}

	public int getVariables() {
		return variables;
	}

	public int getClauses() {
		return clauses;
	}

	public long getCnfSeed() {
		return cnfSeed;
	}
}
